import java.util.Scanner;
class SecError extends Exception{
    SecError(){
        System.out.println("密码错误！");
    }
}
class UserError extends Exception{
    UserError(){
        System.out.println("用户名错误!");
    }
}
public class Main {
    public static void main(String[] args)throws UserError, SecError{
        String a = "123456";
        String b = "kzf";
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入用户名");
        String c = scan.nextLine();
        System.out.println("请输入密码");
        String d = scan.nextLine();
        if (a.equals(c) && b.equals(d)) {
            System.out.println("登陆成功！");
        }
        if(a.equals(c)==false){
            UserError UserError=new UserError();
            throw UserError;
        }
        if(b.equals(d)==false){
            SecError SecError=new SecError();
            throw SecError;
        }
    }
}